<?php

/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/8/31 11:48
 * Desc: 订单完成
 */
class Listener_Finance_Withdraw_Success extends Listener_Base
{
    public function handle($args)
    {
        $self       = new self();
        $self->args = $args;
        //判断队列是否开启,如果开启则把任务推送到队列
        if ($self->queue_status) {
            //推送到队列执行
            Queue::in('default', Listener_Finance_Withdraw_Success::class, $args);
        } else {
            $self->perform();
        }
    }


    public function perform()
    {
        $withdraw_info =  $this->args;

        //通知会员
        St_SMSService::send_withdraw_msg(NoticeCommon::WITHDRAWAL_SUCCESS,$withdraw_info);
        St_EmailService::send_withdraw_email(NoticeCommon::WITHDRAWAL_SUCCESS,$withdraw_info);
    }
}